<%@page import="com.entity.Employee"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
</head>
<body>

	<%
		Employee employee=(Employee)session.getAttribute("employee");
	 %>
	
	<div class="navbar" >
		<div class="navbar-inner">
			<div class="container" style="width:800px">
				<a class="brand" href="projectlist.jspx">HD项目管理</a>
				<a class="brand" style="font-size:16px;padding-top:11px" href="member.jspx">成员管理</a>
				<div class="nav-collapse">
					<ul class="nav pull-right">
						
						<li class="dropdown">
						  <a data-toggle="dropdown" class="dropdown-toggle" href="#"><%=employee.getUsername() %> <b class="caret"></b></a>
						  <ul class="dropdown-menu">
							<li><a href="#uphead" data-toggle="modal">上传头像</a></li>
							<li><a href="#myModal" data-toggle="modal">安全退出</a></li>
						  </ul>
						</li>
						
				  </ul>
				</div>
			</div>
		</div>
    </div>
    
    <div class="modal hide fade" id="uphead">
    	<form class="form-horizontal" id="uploadheadform" action="uploadhead.jspx" method="post" enctype="multipart/form-data">
	        <fieldset>
	          <legend>上传头像</legend>
	        
			  <div class="control-group">
	            <label for="input01" class="control-label"></label>
	            <div class="controls">
	              <input type="file" id="uploadheadfile" name="filename" x-webkit-speech="undefined" class="span5">
	            </div>
	          </div>
	
	          <div class="form-actions">
	            <input class="btn btn-primary" type="button" id="uploadheadbtn" value="保存">
	            <a data-dismiss="modal" class="btn" href="#">返回</a>
	          </div>
	        </fieldset>
      </form> 
    </div>
    
    <div class="modal hide fade" id="myModal">
         <div class="modal-header">
           <a data-dismiss="modal" class="close">×</a>
           <h3>安全退出</h3>
         </div>
         <div class="modal-body">
          	 确定退出吗？
         </div>
         <div class="modal-footer">
           <a data-dismiss="modal" class="btn" href="#">取消</a>
           <a class="btn btn-primary" id="exit" href="exit.jspx">退出</a>
         </div>
     </div>
     
     <script type="text/javascript">
     	$(document).ready(function(){
     		$("#uploadheadbtn").click(function(){
     		var val=$("#uploadheadfile").val();
     			if(val!=""){
     				if(val.match("w*.png$")||val.match("w*.jpg$")||val.match("w*.bmp$")||val.match("w*.gif$")){
     					//alert(true);
	     				$("#uploadheadform").submit();
     				}else{
     					$("#uploadheadfile").val("");
     					alert("上传文件不符合图片格式！");
     				}
     			}
     			
     		});
     	});
     </script>
    
</body>
</html>